﻿namespace CodeGenerator.CSharp
{
    /// <summary>
    /// Defines a code unit for a namespace.
    /// </summary>
    public class Namespace : CodeUnit
    {
        public Namespace(string name) : base(name) 
		{ 
			this.IndentationLevel = 0;
            this.CodeUnits.BlankLinesBeforeCodeUnits = 0;
            this.CodeUnits.BlankLinesAfterCodeUnits = 0;
		} 

        public override string ToString()
        {
            CodeBuilder Code = new CodeBuilder();
            Code.Add(base.Padding + "namespace " + this.Name);
            Code.Add(base.Padding + "{");
            Code.Add(this.CodeUnits.ToString());
            Code.Add(base.Padding + "}");            
            return Code.ToString();
        }
    }
}
